package am.aua.renju.web.filldata;

import am.aua.renju.databaseaccess.Operations;
import am.aua.renju.entity.SecurityQuestion;
import java.util.List;
import java.util.Map;

/**
 *
 * @author Ara Yeritsian
 */
public class Registered {

    private static void loadSecurityQuestion(Map root) {
        List<SecurityQuestion> securityQuestions = Operations.getInstance().getSecurityQuestins();
        int numOfSecurityQuestion = securityQuestions.size();
        String[] securityQuestionsText = new String[numOfSecurityQuestion];
        for (int i = 0; i < numOfSecurityQuestion; i++) {
            securityQuestionsText[i] = securityQuestions.get(i).getQuestionString();
        }
        root.put("securityQuestions", securityQuestionsText);
    }

    public static Map load(Map root) {
        loadSecurityQuestion(root);
        return root;
    }
}
